﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link href="<%=basePath%>plugins/h_uiadmin_v2.3.4/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath%>plugins/h_uiadmin_v2.3.4/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/Hui-iconfont/1.0.7/iconfont.css" rel="stylesheet" type="text/css" />

<link href="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/ueditor/umeditor1_2_2/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
<link href="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />

<title>新增产品</title>
</head>
<body>
 <div class="pd-20">
  <form  method="post" class="form form-horizontal" id="form1">
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>产品名称：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text" value="" placeholder="输入产品名称" id="name" name="name" datatype="*3-50" nullmsg="请输入产品名称" >
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>产品序列号：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text" value="${sequenceCode}" placeholder="" id="sequenceCode" name="sequenceCode"  readonly="readonly">
      </div>
      <div class="col-4"> </div>
    </div>
    
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>产品图片：</label>
        <div class="formControls col-5">
          <%-- <img alt="浏览图片" src="<%=basePath%>common/css/wglogo.png" name="image" id="image"> --%>
          <!--用来存放item-->
          <div id="fileList" class="uploader-list" style="display:inline;">
	            <div id="WU_FILE_1" class="file-item thumbnail"> 
	                 <img src="${product_default_image_url}" style="width:100px;height:100px;"> 
	                 <div class="info"></div> 
				</div>
          </div>
          <div id="filePicker" style="display:inline;"><i class="Hui-iconfont">&#xe642;</i>选择图片</div>
       </div>
       <input type="hidden" id="image" name="image" value="${product_default_image_url}">
      <!--用来存放item-->
   <!--    <div id="fileList" class="uploader-list"></div>
      <div id="filePicker"><i class="Hui-iconfont">&#xe642;</i>选择图片</div> -->
      <div class="col-4"></div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>是否热销：</label>
      <div class="formControls col-5"> <span class="select-box">
           <select class="select"  size="1" id="isHot" name="isHot"  datatype="*" nullmsg="请选择是否热销！">
		      <!-- <option value="" selected="selected">请选择</option> -->
		      <option value="1">是</option>
		      <option value="2">否</option>
		   </select>
        </span> </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>标签：</label>
      <div class="formControls col-5"> <span class="select-box">
           <select class="select"  size="1" id="tag" name="tag"  datatype="*" nullmsg="请选择标签！">
		      <!-- <option value="" selected="selected">请选择</option> -->
		    
		      <c:if test="${tagList !=null}">
		       <c:forEach items="${tagList}" var="tl">
		        <option value="${tl.value}"> ${tl.description}</option>
		       </c:forEach>
		      </c:if>
		   </select>
        </span> </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>收益类型：</label>
      <div class="formControls col-5"> <span class="select-box">
           <select class="select"  size="1" id="profitType" name="profitType"  datatype="*" nullmsg="请选择收益类型">
		      <!-- <option value="" selected="selected">请选择</option> -->
		      <c:if test="${profitTypeList !=null}">
		       <c:forEach items="${profitTypeList}" var="tl">
		        <option value="${tl.value}"> ${tl.description}</option>
		       </c:forEach>
		      </c:if>
		   </select>
        </span> </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>发行机构：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text" placeholder="请输入发行机构" name="issuer" id="issuer"  datatype="*" nullmsg="请输入产品名称">
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>产品类型：</label>
      <div class="formControls col-5"> <span class="select-box">
           <select class="select"  size="1" id="productType" name="productType"  datatype="*" nullmsg="请选择产品类型">
		      <!-- <option value="" selected="selected">请选择</option> -->
		      <c:if test="${productTypeList !=null}">
		       <c:forEach items="${productTypeList}" var="tl" >
		        <option value="${tl.value}"> ${tl.description}</option>
		       </c:forEach>
		      </c:if>
		   </select>
        </span> </div>
      <div class="col-4"> </div>
    </div>
     <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>投资领域：</label>
      <div class="formControls col-5"> <span class="select-box">
           <select class="select"  size="1" id="investType" name="investType"  datatype="*" nullmsg="请选择投资领域">
		      <!-- <option value="" selected="selected">请选择</option> -->
		      <c:if test="${investTypeList !=null}">
		       <c:forEach items="${investTypeList}" var="tl" >
		        <option value="${tl.value}"> ${tl.description}</option>
		       </c:forEach>
		      </c:if>
		   </select>
        </span> </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>项目规模：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text" placeholder="请输入项目规模,单位万" name="projectTotalAmount" id="projectTotalAmount"  datatype="n" nullmsg="请输入项目规模正整数">
      </div>
      <label>(如:100万)</label>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>资金用途：</label>
      <div class="formControls col-5">
        <textarea rows="10" cols="80" class="textarea" placeholder="请输入资金用途,500字以内" name="fundsUse" id="fundsUse"  dragonfly="true" onKeyUp="textarealength(this,100)" datatype="*" nullmsg="请输入资金用途"></textarea>
        <p class="textarea-numberbar"><em class="textarea-length">0</em>/500</p>
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3">产品期限：</label>
      <div class="formControls col-5"> <span class="select-box">
           <select class="select"  size="1" id="projectTerm" name="projectTerm"  datatype="*" nullmsg="请选择产品期限">
		      <!-- <option value="" selected="selected">请选择</option> -->
		      <c:if test="${projectTermList !=null}">
		       <c:forEach items="${projectTermList}" var="tl" >
		        <option value="${tl.value}"> ${tl.description}</option>
		       </c:forEach>
		      </c:if>
		   </select>
        </span> </div>
      <div class="col-4"> </div> 
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>认购起点：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text" placeholder="请输入认购起点,单位万" name="subscribePoint" id="subscribePoint"  datatype="n" nullmsg="请输入认购起点">
      </div>
      <label>万</label>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red"></span>认购须知：</label>
      <div class="formControls col-5">
        <textarea rows="15" cols="80" class="textarea" placeholder="请输入认购须知,500字以内" name="subscribeNotice" id="subscribeNotice"  dragonfly="true" onKeyUp="textarealength(this,500)"></textarea>
        <p class="textarea-numberbar"><em class="textarea-length">0</em>/500</p>
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>私人顾问：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text" placeholder="请输入私人顾问联系人" name="contacts" id="contacts"  datatype="*" nullmsg="请输入私人顾问">
      </div>
      <div class="col-4"> </div>
    </div>
     <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>私人顾问联系人方式：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text" placeholder="请输入私人顾问手机号" name="contactsMobileNumber" id="contactsMobileNumber"  datatype="m" nullmsg="请输入私人顾问联系人方式">
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>付息类型：</label>
      <div class="formControls col-5"> <span class="select-box">
           <select class="select"  size="1" id="paymentType" name="paymentType"  datatype="*" nullmsg="请选择付息类型">
		      <!-- <option value="" selected="selected">请选择</option> -->
		      <c:if test="${paymentTypeList !=null}">
		       <c:forEach items="${paymentTypeList}" var="tl" >
		        <option value="${tl.value}"> ${tl.description}</option>
		       </c:forEach>
		      </c:if>
		   </select>
        </span> </div>
      <div class="col-4"> </div> 
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red"></span>募集进度：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text " placeholder="请输入数字" name="collectProgress" id="collectProgress" datatype="n" nullmsg="请输入数字">
      </div>
      <label>(如:80%)</label>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red"></span>进度详情：</label>
      <div class="formControls col-5">
        <!-- <textarea rows="10" cols="80" class="input-area" placeholder="请输入进度详情,500字以内" name="progressDetail" id=progressDetail  >
        </textarea> -->
        <!-- 加载编辑器的容器 -->
        <script id="container" name="progressDetail" type="text/plain" style="width:100%;height:400px;">
        </script>
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>预期收益：</label>
      <div class="formControls col-5">
             <table id="tab"   class="table table-striped table-border table-bordered" >
		         <thead>
			         <tr>
			            <td>序号</td>
			            <td>最小金额(万)</td>
			            <td>最大金额(万)</td>
			            <td>预期收益比率</td>
			            <td>备注</td>
			            <td>操作</td>
			       </tr>
		       </thead>
		       <tbody>
		        
		       </tbody>
		     </table><br/>
		   <input type="button" id="but" value="增加" class="btn btn-primary radiu"/>
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>投资地区：</label>
      <div class="formControls col-5"> <span class="select-box">
           <select class="select"  size="1" id="investArea" name="investArea"  datatype="*" nullmsg="请选择投资地区">
		      <!-- <option value="0" selected="selected">请选择</option> -->
		      <c:if test="${investAreaList !=null}">
		       <c:forEach items="${investAreaList}" var="tl" >
		        <option value="${tl.value}"> ${tl.description}</option>
		       </c:forEach>
		      </c:if>
		   </select>
        </span> </div>
      <div class="col-4"> </div> 
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red"></span>详细地址：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text" placeholder="请输入详细地址" name="detailAddress" id="detailAddress" >
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red"></span>抵/质押率：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text" placeholder="请输入数字" name="ratio" id="ratio" >
      </div>
      <label>(如0代表浮动)</label>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red"></span>评级：</label>
      <div class="formControls col-5"> <span class="select-box">
           <select class="select"  size="1" id="rate" name="rate" >
		      <!-- <option value="0" selected="selected">请选择</option> -->
		      <c:if test="${rateList !=null}">
		       <c:forEach items="${rateList}" var="tl" >
		        <option value="${tl.value}"> ${tl.description}</option>
		       </c:forEach>
		      </c:if>
		   </select>
        </span> </div>
      <div class="col-4"> </div> 
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red"></span>大小额配比：</label>
      <div class="formControls col-5"> <span class="select-box">
           <select class="select"  size="1" id="bigSmallProportion" name="bigSmallProportion"   >
		    <!--   <option value="0" selected="selected">请选择</option> -->
		      <c:if test="${bigSmallProportionList !=null}">
		       <c:forEach items="${bigSmallProportionList}" var="tl" >
		        <option value="${tl.value}"> ${tl.description}</option>
		       </c:forEach>
		      </c:if>
		   </select>
        </span> </div>
      <div class="col-4"> </div> 
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red"></span>融资主体：</label>
      <div class="formControls col-5">
         <textarea rows="10" cols="80" class="textarea" placeholder="请输入融资主体,500字以内" name="financeMain" id="financeMain" dragonfly="true" onKeyUp="textarealength(this,500)" ></textarea>
         <p class="textarea-numberbar"><em class="textarea-length">0</em>/500</p>
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red"></span>还款来源：</label>
      <div class="formControls col-5">
          <textarea rows="10" cols="80" class="textarea" placeholder="请输入还款来源,500字以内" name="repaymentSource" id="repaymentSource" dragonfly="true" onKeyUp="textarealength(this,500)" ></textarea>
          <p class="textarea-numberbar"><em class="textarea-length">0</em>/500</p>
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red"></span>风控措施：</label>
      <div class="formControls col-5">
        <textarea rows="10" cols="80" class="textarea" placeholder="请输入风控措施,500字以内" name="measures" id="measures" dragonfly="true" onKeyUp="textarealength(this,500)" ></textarea>
         <p class="textarea-numberbar"><em class="textarea-length">0</em>/500</p>
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red"></span>筹资账号：</label>
      <div class="formControls col-5">
        <textarea rows="10" cols="80" class="textarea" placeholder="请输入筹资账号,500字以内" name="collectAccount" id="collectAccount" dragonfly="true" onKeyUp="textarealength(this,500)" ></textarea>
        <p class="textarea-numberbar"><em class="textarea-length">0</em>/500</p>
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red"></span>状态：</label>
      <div class="formControls col-5"> <span class="select-box">
           <select class="select"  size="1" id="status" name="status"   >
		      <!-- <option value="0" selected="selected">请选择</option> -->
		     <!--  <option value="1" selected="selected">募集中</option>
		      <option value="2"  >募集结束</option>
		      <option value="3"  >下架</option> -->
		      <c:if test="${statusList !=null}">
		       <c:forEach items="${statusList}" var="tl" >
		        <option value="${tl.value}"> ${tl.description}</option>
		       </c:forEach>
		      </c:if>
		   </select>
        </span> </div>
      <div class="col-4"> </div> 
    </div> 
     
     <input type="hidden" id="productProfits" name="productProfits" value="">
     
    <div class="row cl">
      <div class="col-9 col-offset-3">
        <!-- <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;"> -->
        <button  class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i>提交</button>
        &nbsp;&nbsp;<input id="closeBtn"  class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;关闭&nbsp;&nbsp;">
      </div>
    </div>
  </form>
</div>

<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/icheck/jquery.icheck.min.js"></script> 
<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/My97DatePicker/WdatePicker.js"></script> 

<%-- <script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/ueditor/1.4.3/ueditor.all.js"> </script>
<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script> --%>

<script type="text/javascript" charset="utf-8" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/ueditor/umeditor1_2_2/umeditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/ueditor/umeditor1_2_2/umeditor.min.js"></script>
<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/ueditor/umeditor1_2_2/lang/zh-cn/zh-cn.js"></script>
    
<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/webuploader/0.1.5/webuploader.min.js"></script> 
    
<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/js/H-ui.js"></script> 
<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/js/H-ui.admin.js"></script>
<script type="text/javascript" src="<%=basePath%>common/js/cms.js"></script>
<script type="text/javascript" src="<%=basePath%>common/js/webupload.js"></script>
<script type="text/javascript">

$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#form1").Validform({
		tiptype:2,
		beforeSubmit:function(curform){
			 //在验证成功后，表单提交前执行的函数，curform参数是当前表单对象。
            //这里明确return false的话表单将不会提交;
			submitForm(curform) ;
			return false ;
		},
		callback:function(form){
			 
			return false ;
		}
	});
	
	function submitForm(form ){
		$.getTabValToJson();  // 先把动态表格赋到一个type=hidden 中去 
		
		var params = JSON.stringify( $("#form1").serializeJson()) ;
		$.ajax({
			"type": "POST", 
			"url": "<%=basePath%>productmgr/doadd"  , 
		   // "contentType":"application/json;charset=UTF-8",   
			"dataType": "json",  // 预期服务器返回的数据类型
			"data": "params="+params ,      
			"success": function(resp) {
				// console.log(resp) ;
				if(resp.success){
					    var index = parent.layer.getFrameIndex(window.name);
					    parent.$('#queryBtn').click(); 
						parent.layer.close(index);
				}else{
					layer.alert( resp.errMsg, {icon: 2},function(index){
						 layer.close(index);
					  });
				}
				 
			}
		}); 
	}
	
	$("#closeBtn").click(function(){
		var index = parent.layer.getFrameIndex(window.name);
		parent.layer.close(index);
	});
	
	var editor = UM.getEditor('container',{
          // toolbars: [
          //             ['fullscreen', 'source', 'undo', 'redo', 'bold', 'italic', 'underline', 'fontborder', 'backcolor', 'fontsize', 'fontfamily', 'justifyleft', 'justifyright', 'justifycenter', 'justifyjustify', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', 'link', 'unlink', 'emotion', 'help']
          //        ],
          //focus时自动清空初始化时的内容
          autoClearinitialContent:true,
          //关闭字数统计
          wordCount:false,
          //关闭elementPath
          elementPathEnabled:false
		});

	
});

 

</script>
</body>
</html>